<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            overflow-x: hidden;
        }
        ul{
            list-style: none;
            margin:0;
            padding:0;
            position: absolute;
            right:0;
            margin-right:-80px;

        }
        ul>li{
            width: 80px;
            height:50px;
            background-color: aquamarine;
            margin-top:2px;
            border-left:10px solid green;
            text-align: center;
            line-height: 50px;
            position: relative;
            /* right:80px; */
        }
        ul a{
            text-decoration: none;
        }
    </style>
</head>
<body>
    <ul>
        <li><a href="#">菜单1</a></li>
        <li><a href="#">菜单2</a></li>
        <li><a href="#">菜单3</a></li>
        <li><a href="#">菜单4</a></li>
        <li><a href="#">菜单5</a></li>
        <li><a href="#">菜单6</a></li>
        <li><a href="#">菜单7</a></li>
        <li><a href="#">菜单8</a></li>
    </ul>
    <script src="../js/jquery-1.12.4.min.js"></script>
    <script>
        $("ul").hover(function(){
            console.log("ul");
            
            $("ul>li").each(function(i){
                setTimeout(() => {
                    $(this).animate({
                        right:"80px"
                    },500);
                },i*50)
                
            })
        },function(){
            $("ul>li").each(function(i){

                setTimeout(() => {
                    $(this).animate({
                        right:0
                    },500,() => {
                        $(this).stop(true,false);
                    });
                },i*50)
                
            })
        });
    </script>
</body>
</html>